#include "dma.h"
#include "nt35510.h"

void DMA_Initialization(void)
{
  DMA_InitTypeDef DMA_InitStructure={0};

  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1,ENABLE);

  DMA_InitStructure.DMA_BufferSize=0x00;
  DMA_InitStructure.DMA_DIR=DMA_DIR_PeripheralDST;
  DMA_InitStructure.DMA_M2M=DMA_M2M_Enable;
  DMA_InitStructure.DMA_MemoryBaseAddr=0x00;
  DMA_InitStructure.DMA_MemoryDataSize=DMA_MemoryDataSize_HalfWord;
  DMA_InitStructure.DMA_MemoryInc=DMA_MemoryInc_Enable;
  DMA_InitStructure.DMA_Mode=DMA_Mode_Normal;
  DMA_InitStructure.DMA_PeripheralBaseAddr=(uint32_t)NT35510->NT35510_RAM;
  DMA_InitStructure.DMA_PeripheralDataSize=DMA_PeripheralDataSize_HalfWord;
  DMA_InitStructure.DMA_PeripheralInc=DMA_PeripheralInc_Disable;
  DMA_InitStructure.DMA_Priority=DMA_Priority_VeryHigh;
  DMA_Init(DMA1_Channel1,&DMA_InitStructure);
}